<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/styles.css" />
	<title>Errore Cancellazione Volo</title>
</h:head>

<h:body>
<div id="header">
	<ui:include src="/resources/snippets/headerDipendente.xhtml"></ui:include>
</div>
	<h1> Escursione non eliminabile</h1>
	<p>Attenzione: per poter eliminare l'escursione devi prima modificare o eliminare i pacchetti che la contengono!</p>
	<p>L'escursione che vuoi eliminare è presente in questi pacchetti:</p>
	<h:dataTable value="#{escursione.listaPacchetti}" var="paccCurr">
    	<h:column>
    		<f:facet name="header">Destinazione</f:facet>
    		<h:outputText value="#{paccCurr.citta}"/>
    	</h:column>
 		<h:column>
    		<f:facet name="header">Volo di Andata</f:facet>
    		<h:outputText value="#{paccCurr.voloAndata.codice}"/>
    	</h:column>
    	<h:column>
    		<f:facet name="header">Volo di Ritorno</f:facet>
    		<h:outputText value="#{paccCurr.voloRitorno.codice}"/>
    	</h:column>
    	<h:column>
    		<f:facet name="header">(Primo) Hotel</f:facet>
    		<h:outputText value="#{paccCurr.hotels.isEmpty() ? '-nessuno-' : paccCurr.hotels.get(0).nome}"/>
    	</h:column>
    	<h:column>
    		<f:facet name="header">(Prima) Escursione</f:facet>
    		<h:outputText value="#{paccCurr.escursioni.isEmpty() ? '-nessuna-' : paccCurr.escursioni.get(0).luogoInteresse}"/>
    	</h:column>
    	<h:column>
    		<h:form>
				<h:commandButton value="Elimina" action="#{pacchetto.delete(paccCurr)}" styleClass="styleButton"/>
			</h:form>
    	</h:column>
    	<h:column>
    		<h:form>
				<h:commandButton  value="Modifica" action="#{pacchetto.iniziaModifica(paccCurr)}"  />
			</h:form>
   		</h:column>
   	</h:dataTable>
   	<br/>
   	<br/>
	<h:link outcome="elencoEscursioni" value="Torna Indietro" />
	<br/>
	<br/>
	<br/>
<div id="footer">
	<ui:include src="/resources/snippets/footer.xhtml"></ui:include>
</div>
</h:body>
</html>